<template>
  <div>
    <!--博客列表-->
    <div class="blog-list">
      <!--置顶-->
      <div class="blog-item" v-for="item in 11" :key="item">
        <div class="blog-info">
          <div class="blog-title">
            带缩略图的新闻标题,最多显示三行,超过长度截取为省略号
          </div>
          <div class="blog-desc">
            <div class="blog-desc-msg">
              <span class="blog-author">瑟琳</span>
              <span class="blog-comments">27评论</span>
              <span class="blog-last-time">3小时前</span>
            </div>
            <div class="blog-control-icon">
              <van-icon name="ellipsis" @click="showPopup" />
            </div>
          </div>
        </div>
        <div class="blog-picture">
          <img
            src="../../../../public/e639994661714beca0075b5399e395e4.jpeg"
            alt=""
            class="blog-img"
          />
          <!--图片的角标-->
          <div class="badge">文章</div>
        </div>
      </div>
    </div>
    <van-popup v-model:show="show" position="bottom" :style="{ height: '30%' }">
      <van-cell-group>
        <van-cell title="单元格" value="内容" />
        <van-cell title="单元格" value="内容" />
        <van-cell title="单元格" value="内容" />
      </van-cell-group>
    </van-popup>
  </div>
</template>
<script setup>
import { ref } from "vue";
const show = ref(false);
const showPopup = () => {
  show.value = true;
};
</script>
<style scoped lang="less">
.blog-list {
  height: 80vh;
  overflow-y: scroll;
  background-color: #f7f7f7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  .blog-item {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 10px 0;
    border-radius: 10px;
    margin: 10px 0 10px;
    background-color: #fff;
    .blog-picture {
      width: 25vh;
      height: 200rpx;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 0 10px;
      position: relative;

      .blog-img {
        width: 25vh;
      }
      .badge {
        position: absolute;
        bottom: 10px;
        right: 10px;
        width: 40px;
        height: 30px;
        background-color: rgba(0, 0, 0, 0.5);
        border-radius: 60px;
        color: #fff;
        font-size: 12px;
        text-align: center;
        line-height: 30px;
      }
    }
    .blog-info {
      height: 200rpx;
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      padding: 0 10px;
      .blog-title {
        width: 190rpx;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 16px;
        font-weight: 600;
        color: #333;
      }
      .blog-desc {
        width: 190rpx;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .blog-desc-msg {
          font-size: 12px;
          color: #999;
          .blog-author {
            margin-right: 10px;
          }
          .blog-comments {
            margin-right: 10px;
          }
        }
        .blog-control-icon {
          width: 20px;
        }
      }
    }
  }
}
</style>
